import useRequest from '@/hooks/useRequest';
const { request, post, get } = useRequest();
import {
	getProfileById,
	getUserInfo,
	getCategoryFirstList,
	getCategoryTwoList,
	uploadImgFile,
	upprofile,
	doUppwd,
	getHelpList,
	addKfMsg,
	getConfig,
	getUseryPhone,
	getASKOrderInfo,
	askOrderEnd,
	getProfileByuuid,
	queryCaseOrderInfo,
	getComOrder,
	queryWeikuanPayStatus,
	getProvinceList,
	getCityList
} from '@/api/common.ts';
export {
	getProfileById,
	getUserInfo,
	getCategoryFirstList,
	getCategoryTwoList,
	uploadImgFile,
	upprofile,
	doUppwd,
	getHelpList,
	addKfMsg,
	getConfig,
	getUseryPhone,
	getASKOrderInfo,
	askOrderEnd,
	getProfileByuuid,
	queryCaseOrderInfo,
	getComOrder,
	queryWeikuanPayStatus,
	getProvinceList,
	getCityList
};
import { getWithdrawalList, getAccountList, getBankGetList, addBank, recharge, withdrawal, getBankTypeList } from '@/api/purse.ts';

export { getWithdrawalList, getAccountList, getBankGetList, addBank, recharge, withdrawal, getBankTypeList };
// 获取律师角色
export const getLawyerRole = () => {
	return request({
		url: 'lawyer/login/get_role_list',
		custom: {
			auth: false
		}
	});
};
// 登录
export const login = (data) => {
	return post({
		url: 'lawyer/login/login',
		data,
		custom: {
			auth: false
		}
	});
};

// 发送信息
export const sendMsg = (data : any) => {
	return post({
		url: 'lawyer/chat/send_msg',
		data,
		header: {
			'content-Type': 'application/x-www-form-urlencoded',
		},
		custom: {
			auth: true
		}
	});
};
// 获取信息
export const getMsg = (data) => {
	return post({
		url: 'lawyer/chat/msg_list',
		data,
		custom: {
			auth: true
		}
	});
};

// 获取首页轮播图
export const bannerList = (data ?: any) => {
	return request({
		url: 'currency/index/banner_list',
		method: 'get',
		data: {
			type: 2,
			...data
		}
	});
};

// 通过咨询发送案件
export const imPubOrder = (data ?: any) => {
	return request({
		url: 'lawyer/anjian/pub_order',
		method: 'post',
		data: {
			...data
		}
	});
};

// 通过咨询发送案件
export const pubWeikuanOrder = (data ?: any) => {
	return request({
		url: 'lawyer/anjian/pub_weikuan_order',
		method: 'post',
		data: {
			...data
		}
	});
};
// 获取案件列表
export const getCaseORderList = (data ?: any) => {
	return request({
		url: 'lawyer/anjian/order_list',
		method: 'post',
		data: data
	});
};
// 拒绝案件
export const doCaseDenyOrder = (data ?: any) => {
	return request({
		url: 'lawyer/anjian/deny_order',
		method: 'post',
		data: data
	});
};
// 接单
export const doCaseReceiveOrder = (data ?: any) => {
	return request({
		url: 'lawyer/anjian/receive_order',
		method: 'post',
		data: data
	});
};
// 完成订单
export const doCaseFinishOrder = (data ?: any) => {
	return request({
		url: 'lawyer/anjian/finish_order',
		method: 'post',
		data: data
	});
};

// 新增提醒
export const doAddTips = (data : any) => {
	return request({
		url: 'lawyer/tools/create_tips',
		method: 'post',
		data: data
	});
}
// 提醒列表
export const getTipsList = (data : any) => {
	return request({
		url: 'lawyer/tools/get_tips_list',
		method: 'post',
		data: data
	});
}
// 提醒详情
export const getTipsInfo = (data : any) => {
	return request({
		url: 'lawyer/tools/get_tips_info',
		method: 'get',
		data: data
	});
}


// 新增备注
export const doAddNotes = (data : any) => {
	return request({
		url: 'lawyer/tools/create_notes',
		method: 'post',
		data: data
	});
}
// 备注列表
export const getNotesList = (data : any) => {
	return request({
		url: 'lawyer/tools/get_notes_list',
		method: 'post',
		data: data
	});
}
// 备注详情
export const getNotesInfo = (data : any) => {
	return request({
		url: 'lawyer/tools/get_notes_info',
		method: 'get',
		data: data
	});
}
// 备注更新
export const doUpdateNotes = (data : any) => {
	return request({
		url: 'lawyer/tools/update_notes',
		method: 'post',
		data: data
	});
}


// 获取律师首页数据
export const getIndexDataInfo = (data ?: any) => {
	return request({
		url: 'lawyer/index/get_data_info',
		method: 'get',
		data: data
	});
}

// 获取律师首页数据
export const onUpdateOnline = (data ?: any) => {
	return request({
		url: 'lawyer/index/update_online',
		method: 'post',
		data: data
	});
}
// 查询法律法规
export const getLawList = (data ?: any) => {
	return request({
		url: 'currency/law/get_list',
		method: 'get',
		data
	});
};

// 法律法规详情
export const getLawInfo = (data ?: any) => {
	return request({
		url: 'currency/law/info',
		method: 'get',
		data
	});
};
// 获取LPR 利率
export const getLprList = (data ?: any) => {
	return request({
		url: 'lawyer/tools/get_lpr_list',
		method: 'get',
		data
	});
};

export default {
	getLawyerRole,
	login,
	sendMsg,
	getMsg,
	bannerList,
	imPubOrder,
	pubWeikuanOrder
};